#include "SQLTable.h"

#include "../RealObject/Accessory.h"

class CAccessoryTable : public CSqlTable
{
public:
	CAccessoryTable();
	static bool checkCode(CString sCode,CAccessory* &pAccessory);

	static bool updateTable(CAccessory* pAccessory);
	static bool InsertAccessory(const CAccessory* pAccessory);
	static vector<CAccessory*>  getListAccessory(const CString& sCode);
	static bool checkProduct(const CAccessory *pSearch,CAccessory* &pFound);

	static CAccessory* getByProductCode(const CString& sProductCode);
	static CAccessory* getByProductCodeAtStore(const CString& sProductCode,const CString& sStoreCode);
	static int getCountAccessory(const CString& sCodeProduct,const CString& sCodeStore);
	static bool deleteRecord(CString sKey);
	static int  getMaxCode();

	static bool sellAccossory(CString sCode, int nCount);

	static bool getTypeAccRemain(const CString& sCodeStore,vector<CString>& vtCodeProduct, vector<int>&vtCount);


};